{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">编辑表单</div>
    <div class="layui-card-body">
        <form class="layui-form w300" method="post">
            <div class="layui-form-item">
                <label>表单名称</label>
                <div claclass="layui-form-field-label">
                    <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="表单名称" class="layui-input" value="{$data.name}">
                </div>
                <div class="layui-form-mid layui-word-aux">模型中文名称，用于添加栏目时选择使用。</div>
            </div>
            <div class="layui-form-item">
                <label>表单键名</label>
                <div claclass="layui-form-field-label">
                    <input type="text" name="tablename" lay-verify="required" autocomplete="off" placeholder="表单键名" class="layui-input" value="form_{$data.tablename}" disabled style="cursor: not-allowed !important;">
                </div>
                <div class="layui-form-mid layui-word-aux">由小写字母组成</div>
            </div>
            <div class="layui-form-item">
                <label>简介</label>
                <div class="layui-input-inline w300">
                    <textarea name="description" placeholder="表单的相关描述" class="layui-textarea">{$data.description}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label>跳转地址</label>
                <div claclass="layui-form-field-label">
                    <input type="text" name="setting[forward]" autocomplete="off" placeholder="提交后跳转地址" class="layui-input" value="{$data.setting.forward}">
                </div>
            </div>
            <div class="layui-form-item">
                <label>邮件地址</label>
                <div claclass="layui-form-field-label">
                    <input type="text" name="setting[mails]" autocomplete="off" placeholder="接受邮件的地址" class="layui-input" value="{$data.setting.mails}">
                </div>
                <div class="layui-form-mid layui-word-aux">留空为不接收，多个地址请用“,”隔开</div>
            </div>
            <div class="layui-form-item">
                <label>提交间隔</label>
                <div claclass="layui-form-field-label">
                    <input type="text" name="setting[interval]" autocomplete="off" placeholder="提交间隔" class="layui-input" value="{$data.setting.interval}">
                </div>
                <div class="layui-form-mid layui-word-aux">单位秒，0为不限</div>
            </div>
            <div class="layui-form-item">
                <label>IP多次提交</label>
                <div claclass="layui-form-field-label">
                    <input type="radio" name="setting[allowmultisubmit]" value="1" title="是" {if $data.setting.allowmultisubmit==1}checked{/if}>
                    <input type="radio" name="setting[allowmultisubmit]" value="0" title="否" {if $data.setting.allowmultisubmit==0}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <label>游客提交</label>
                <div claclass="layui-form-field-label">
                    <input type="radio" name="setting[allowunreg]" value="1" title="是" {if $data.setting.allowunreg==1}checked{/if}>
                    <input type="radio" name="setting[allowunreg]" value="0" title="否" {if $data.setting.allowunreg==0}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <label>开启验证码</label>
                <div claclass="layui-form-field-label">
                    <input type="radio" name="setting[isverify]" value="1" title="是" {if $data.setting.isverify==1}checked{/if}>
                    <input type="radio" name="setting[isverify]" value="0" title="否" {if $data.setting.isverify==0}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <label>状态</label>
                <div claclass="layui-form-field-label">
                    <input type="radio" name="status" value="1" title="启用" {if $data.status==1}checked{/if}>
                    <input type="radio" name="status" value="0" title="禁用" {if $data.status==0}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item web_list">
                <label>模板选择</label>
                <div class="w300">
                    {php} echo \util\Form::select($show_template,$data['setting']['show_template'], 'name="setting[show_template]"') {/php}
                </div>
                <div class="layui-form-mid layui-word-aux">新增模板以show_xx.html形式</div>
            </div>
            <input type="hidden"name="id" value="{$data.id}">
            <div class="layui-form-item">
                <div>
                    <button class="layui-btn" lay-submit="" lay-filter="formSubmit">立即提交</button>
                    <button class="layui-btn layui-btn-normal" type="button" onclick="javascript:history.back(-1);">返回</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}